<%@ page import="uk.co.gavin.Person" %>
<%@ page import="uk.co.gavin.Skill" %>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="layout" content="volunteer"/>
  <title>YMBBT - Volunteer</title>
</head>
<body>

<div class="body">
  <h1>VOLUNTEERING APPLICATION FORM</h1>
  <g:form action="save" method="post">
    <div class="dialog">
      <table>
        <tbody>

        %{--Subsection Headers--}%
        <tr>
          <td><b>Contact Details</b></td><td><b>Roles</b></td><td><b>Interested in Driving?</b></td><td><b>Additional Information</b></td>
        </tr>

        %{-- Basic Contact info --}%

        <tr>
          <td VALIGN="top">
            <table>
              <tr class="prop">
                <td valign="top" class="name">
                  <label for="firstName">First Name:</label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: personInstance, field: 'firstName', 'errors')}">
                  <g:textField name="firstName" maxlength="12" value="${personInstance?.firstName}"/>
                </td>
              </tr>

              <tr class="prop">
                <td valign="top" class="name">
                  <label for="lastName">Last Name:</label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: personInstance, field: 'lastName', 'errors')}">
                  <g:textField name="lastName" maxlength="12" value="${personInstance?.lastName}"/>
                </td>
              </tr>

              <tr class="prop">
                <td valign="top" class="name">
                  <label for="email">Email:</label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: personInstance, field: 'email', 'errors')}">
                  <g:textField name="email" maxlength="20" value="${personInstance?.email}"/>
                </td>
              </tr>

              <tr class="prop">
                <td valign="top" class="name">
                  <label for="phoneNumber">Phone Number:</label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: personInstance, field: 'phoneNumber', 'errors')}">
                  <g:textField name="phoneNumber" maxlength="12" value="${personInstance?.phoneNumber}"/>
                </td>
              </tr>
            </table>
          </td>
          %{-- Skills --}%
          <td VALIGN="top">
            <table>
            <g:each var='s' in='${Skill.getAll()}'> 
           	 <tr class="prop">
                 <td>
					<input type="checkbox" name="skills" value="${s.id}" />  
					${s.name} 
                 </td>
              </tr>   
			</g:each> 
            </table>
          </td>
          %{-- Additional info --}%
          <td VALIGN="top">
            <table>
            
            <!-- 
              <tr class="prop">
                <td valign="top" class="name">
                  <label for="core">Core:</label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: personInstance, field: 'core', 'errors')}">
                  <g:checkBox name="core" value="${personInstance?.core}"/>
                </td>
              </tr> -->

                <tr class="prop">
                  <td valign="top" class="name">
                    <label for="employedFullTime">Employed Full Time:</label>
                  </td>
                  <td valign="top" class="value ${hasErrors(bean: personInstance, field: 'employedFullTime', 'errors')}">
                    <g:checkBox name="employedFullTime" value="${personInstance?.employedFullTime}"/>
                  </td>
                </tr>

              <tr class="prop">
                <td valign="top" class="name" colspan="2">
                  <label for="notes" style="line-height : 14px;"><b>Please share with us; <ul><li>Relevant experience</li><li>Unique skills</li><li>Hobbies</li> <li>What you hope to get out of the experience</li></ul></b></label>
               	  <br>
               	  <div valign="top" class="value ${hasErrors(bean: personInstance, field: 'notes', 'errors')}">
                    <g:textArea name="notes" cols="40" rows="5" value="${personInstance?.notes}"/>
                  </div>
                </td>
              </tr>
            </table>
          </td>     
            <tr><td colspan="4">
        	<div id="warning" class="paragraph">
  			WARNING: Being a Bum Bum Train performer or builder is hard work. As a performer you would be expected to repeat a scene approximately 100 times, for at least 4 hours with one short break. As a builder you will be expected to help build the sets from scratch in a short space of time.
  			<br><br>
  			Thank you for your interest.
  			</div>
          </td></tr>
				<tr>
					<td colspan="4"><g:if test="${flash.message}">
						<div class="message">
						${flash.message}
						</div>
					</g:if> <g:hasErrors bean="${personInstance}">
						<div class="errors"><g:renderErrors bean="${personInstance}"
							as="list" />
						</div>
					</g:hasErrors>
					</td>
				</tr>
			</tbody>
      </table>
    </div>
    
    <div class="buttons">
      <span class="button"><a id="back" class="back" href="/contact.php">Back</a></span>
      <span class="button"><input class="save" type="submit" value="Volunteer"/></span>
    </div>
  </g:form>
</div>
</body>
</html>

